package com.bringway.global.domain;
import java.util.ArrayList;
import java.util.Collection;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
/*
* @author 作者 xuef
* @version 创建时间：2015年11月30日 下午2:45:04
* 类说明
*/
public class SysUserDetails implements UserDetails{

	//id
	private String id;
	
	//员工号
	private String gyh;
	
	//用户姓名
	private String username;
	
	//用户密码
	private String password;
	
	//角色ID
	private String roleId;
	
	//角色名称
	private String roleName;
	
	//手机号码
	private String sjhm;
	
	public String getSjhm() {
		return sjhm;
	}

	public void setSjhm(String sjhm) {
		this.sjhm = sjhm;
	}

	private Collection<GrantedAuthority> authorities = new ArrayList();
		
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getGyh() {
		return gyh;
	}

	public void setGyh(String gyh) {
		this.gyh = gyh;
	}

	public String getRoleId() {
		return roleId;
	}

	public void setRoleId(String roleId) {
		this.roleId = roleId;
	}

	public String getRoleName() {
		return roleName;
	}

	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public void setAuthorities(Collection<GrantedAuthority> authorities)
	{
	    this.authorities = authorities;
	}
	
	@Override
	public Collection<? extends GrantedAuthority> getAuthorities() {
		return this.authorities;
	}

	@Override
	public String getPassword() {
		return this.password;
	}

	@Override
	public String getUsername() {
		return this.username;
	}

	@Override
	public boolean isAccountNonExpired() {
		return true;
	}

	@Override
	public boolean isAccountNonLocked() {
		return true;
	}

	@Override
	public boolean isCredentialsNonExpired() {
		return true;
	}

	@Override
	public boolean isEnabled() {
		return true;
	}

}
